package com.yitiao.designmodel.behave.chain.check;

/**
 * 测试类
 */
public class HandlerClient {
    public static void main(String[] args) {
        AbstractCheckHandler handler = buildHandlerChain();
        ProductVO productVO = ProductVO.builder()
                .skuId(111L)
                .skuName("12131")
                .build();
        System.out.println(handler.handle(productVO));
    }

    private static AbstractCheckHandler buildHandlerChain() {
        NullValueCheckHandler nullValueCheckHandler = new NullValueCheckHandler();
        PriceCheckHandler priceCheckHandler = new PriceCheckHandler();
        nullValueCheckHandler.setNextHandler(priceCheckHandler);
        return nullValueCheckHandler;
    }
}
